package com.lxt.filemanager.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lxt.filemanager.entity.DFSAddress;
import com.lxt.filemanager.entity.TblFile;
import org.csource.common.MyException;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 文件服务
 */
public interface TblFileService extends IService<TblFile> {
    /**
     * 上传文件
     * @param file
     * @param data
     * @return
     */
    boolean upLoad(TblFile file,byte[] data) throws IOException, MyException;

    /**
     * 下载文件
     * @param dfsAddress
     * @return
     */
    DFSAddress download(Integer id) throws IOException, MyException;

    /**
     * 删除文件
     * @param dfsAddress
     * @return
     */
    boolean delete(Integer id) throws IOException, MyException;
}
